import { ref } from 'vue'
import { defineStore } from 'pinia'

export const userInfoState = defineStore('userInfoState', () => {
    const Username = ref('未知')
    const UserId = ref()
    const Nickname = ref('未知')
    const Phone = ref('')
    const Email = ref('')

    function setUsername(data){
        Username.value = data
    }
    function getUsername(){
        return Username.value
    }
    function setUserId(data){
        UserId.value = data
    }
    function getUserId(){
        return UserId.value
    }
    function setNickname(data){
        Nickname.value = data
    }
    function getNickname(){
        return Nickname.value
    }
    function setPhone(data){
        Phone.value = data
    }
    function getPhone(){
        return Phone.value
    }
    function setEmail(data){
        Email.value = data
    }
    function getEmail(){
        return Email.value
    }

    return {Username,UserId,Nickname,Phone,Email,
        setUsername,getUsername,
        setUserId,getUserId,
        setNickname,getNickname,
        setPhone,getPhone,
        setEmail,getEmail}
})
